#include<stdio.h>
#include<stdlib.h>
int main(){
    FILE* file = fopen("test2.txt","r");
    if(!file){
        return -1;
    }
    char buf[1024]={0};
    fgets(buf, 1024, file);
    printf("%s", buf);
    fgets(buf, 1024, file);
    printf("%s", buf);
    fseek(file,0,SEEK_SET);
    fgets(buf, 1024, file);
    printf("%s", buf);
    fseek(file,2, SEEK_SET);
    fgets(buf, 1024, file);
    printf("%s", buf);
  
    fseek(file, -2, SEEK_END);
    fgets(buf, 1024, file);
    printf("%s", buf);
    rewind(file);
    fgets(buf, 1024, file);
    printf("%s", buf);
    fclose(file);
    return 0;
}